﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<dynamic>" %>
<%@ Import Namespace="skags.Models" %>

<div class="newest_news">
<h2>Nýjustu fréttir</h2>

    <% foreach (var item in (IEnumerable<NewsViewModel>)ViewData["NewestNews"]) { %>
    
       
       <span class="title"><a href="/News/ViewItem/<%: item.ID %>"> <%: item.Title %></a></span> <br />
       <span class="categoryName"> <%= item.CategoryName %> </span> 
       <span class="read_count">( <%: item.ReadCount.ToString() == "" ? 0 : item.ReadCount %> )</span> <br />
       <span class="author"> <%: item.CreatorName %> </span>
       <span class="date">Þann <%= String.Format("{0:g}", item.DateCreated) %></span>
        <br /><br />     
    <% } %>
<br />
</div>
    